<template>
<ol>
    <li v-for="item in homework" :key="item.hid">
        <div>
            {{item.topic}}
        </div>
        <div class="content">
            <el-form :item="item">
                <el-form-item :prop="item.update">
                    <el-radio-group v-model="item.update"  @change="sendValue(item.update,item.hid)">
                        <el-radio :label="item.optionA" >A:{{item.optionA}}</el-radio>
                        <el-radio :label="item.optionB">B:{{item.optionB}}</el-radio>
                        <el-radio :label="item.optionC">C:{{item.optionC}}</el-radio>
                        <el-radio :label="item.optionD">D:{{item.optionD}}</el-radio>
                    </el-radio-group>
                </el-form-item>
            </el-form>
            
            <h3>答案为: {{item.answer}}</h3>
            <h4 v-if="isShow">{{hw.true ? "正确" : "错误"}}</h4>
        </div>
    </li>
    <h2 v-if="isShow">成绩: {{result.result}}</h2>
    <!-- <el-button type="success" @click.native="changeShow(hw.eid)">提交</el-button> -->
</ol>
</template>
<script>
import {mapGetters} from 'vuex';
export default {
    name:'HomeWork',
    data () {
      return {
      };
    },
    computed:{
        ...mapGetters(['homework'])
    },

}
</script>

<style scoped>
.content{
    margin-top: 25px;
}
ol li{
    margin-top: 30px;
}
</style>